package com.lwl.blog.core.utils;

import org.mindrot.jbcrypt.BCrypt;

public class PasswordUtils {

    // 加密
    public static String hashPw(String pw) {
        return BCrypt.hashpw(pw, BCrypt.gensalt());
    }

    // 比对
    public static boolean check(String pw, String dbPw) {
        return BCrypt.checkpw(pw, dbPw);
    }
}